package com.shelpe.service.simbaproxy.filter;

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;

public class ContentTypeFilter extends ZuulFilter {

	@Override
	public boolean shouldFilter() {
		RequestContext ctx = RequestContext.getCurrentContext();

		return ctx.getRouteHost() != null;
	}

	@Override
	public Object run() {
		RequestContext context = RequestContext.getCurrentContext();
		context.addZuulResponseHeader("Content-Type", "application/json");
		return null;
	}

	@Override
	public String filterType() {
		return "post";
	}

	@Override
	public int filterOrder() {
		return 999;
	}

}
